<?php

@ob_start();

$_SERVER['IN_ADMIN']    = true;
$_SERVER['BASE_PATH']   = dirname(__FILE__) . '/';

require_once $_SERVER['BASE_PATH'] . 'lib/' . 'admin.php';
require_once $_SERVER['BASE_PATH'] . 'lib/' . 'config.php';
require_once $_SERVER['BASE_PATH'] . 'lib/' . 'generate.php';
require_once $_SERVER['BASE_PATH'] . 'lib/' . 'mysql.php';
require_once $_SERVER['BASE_PATH'] . 'lib/' . 'param.php';
require_once $_SERVER['BASE_PATH'] . 'lib/' . 'session.php';
require_once $_SERVER['BASE_PATH'] . 'lib/' . 'url.php';

$_SERVER['BASE_URL']    = url_get_current_path() . '/';

$title = '标题'; // default title

$action = @ $_GET['action'];
$action = preg_replace("/[^0-9a-z]/", "", strtolower(trim($action)));

if(empty($action)) {
    require_once $_SERVER['BASE_PATH'] . '/admin/admin_index.php';
} elseif (file_exists($_SERVER['BASE_PATH'] . '/admin/admin_' . $action . '.php')){
    require_once $_SERVER['BASE_PATH'] . '/admin/admin_' . $action . '.php';
} else {
    url_404();
}


